
export default {

  namespaced: true,

  state: {
    //用来表示提示框显示或者隐藏false
     isShowToast:false,
     msg:"",
     type:""
  },
  mutations: {
     changeIsShowToastModal(state,payload){
         state.isShowToast =payload.isShow;
         state.msg = payload.msg;
         state.type = payload.type;
     }
  },




  
  actions: { 
    //异步的代码要放在actions中
    asyncchangeIsShowToastModal(context,payload){
      context.commit("changeIsShowToastModal",{
        isShow:true,
        msg:payload.msg,
        type:payload.type
      });
       setTimeout(()=>{
           context.commit("changeIsShowToastModal",{
           isShow:false,
           msg: payload.msg,
           type : payload.type
       });
       },1500)
    }
  }
}
